<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <title></title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <link rel="stylesheet" type="text/css" href="/static/shop/css/style.css"/>
  <link rel="stylesheet" type="text/css" href="/static/shop/css/swiper.min.css"/>
  <link rel="stylesheet" type="text/css" href="/static/shop/css/LCalendar.css">
  <style type="text/css">
    a {
      color:#999596;
      text-decoration:none;
    }
	.login img {
		width: 10rem;
		margin-left: 0.5rem;
		margin-top: 0.5rem;
	}
	.login {
		width: 100%;
		display: block;
		justify-content: space-around;
		margin-top: .5rem;
	}
	.login ul {
		float: right;
		margin-right: 2.4rem;
	}
  </style>
</head>
<body>
<div class="login">
	<a href="{:url('/')}"><img src="/static/shop/img/logo.png" /></a>
  <ul>
    {notempty name='user'}
    <!--<a href="/account/update/" title="" class="ucter">
            欢迎  {$user.mobile}
        </a>
        <span class="separate">|</span>-->
    <a href="{:url('shop/account/index')}" title="个人中心">个人中心</a>
    <span class="separate">|</span>
    <!--
                        <a href="{:url('shop/account/love')}" title="我的关注">我的关注</a>

                        <span class="separate">|</span>
                        <a href="{:url('shop/artwork/cart')}" title="购物车">购物车</a>
                        <span class="separate">|</span>-->
    <a href="{:url('shop/login/logout')}" title="退出">退出</a>
    {else/}

    <li><a href="{:url('shop/login/index')}" title="登录">登录</a></li>
    <li>|</li>
    <li><a href="{:url('shop/login/register')}" title="注册">注册</a></li>
    {/notempty}
  </ul>
</div>

{include file="public:nav"/}
  		
  		<p class="order_li">确认订单</p>
  		<p class="order_list">订单详情</p>
  		<ul class="order">
  			<li>
  				<img src="/{$img.path}" />
  				<div class="order_small">
            <input type="hidden" id="arwork_id" name="id" value="{$artwork.id}">
  					<p class="order_title" id="arwork_title" data-title="{$artwork.title}">《{$artwork.title}》<span></span></p>
  					<p class="order_money">购物金额小计{$artwork.price}RMB</p>
  				</div>
  			</li>
  			<li id="order_only">
  				<b>收货人信息</b>
           <input type="hidden" id="address_id" name="id" value="{$address.id}">
  				<p id="addrname" data-name="{$address.name}">收货人姓名：{$address.name}</p>
  				<p>E-mail：{$address.email}</p>
  				<p id="address" data-addr="{$address.address1}">详细地址：{$address.address1}</p>
  				<p id="mobile" data-tel="{$address.mobile}">手机：{$address.mobile}</p>
  				<div class="order_chai">
  				<b>费用统计</b>
  				<p>作品总价：{$artwork.price}  RMB</p>
  				</div>
  				<div class="order_border"></div>
  				<p>*该订单完成后，您将获得 0.00RMB 的红包</p>
  				<p id="price" data-price="{$artwork.price}">应付款金额：{$artwork.price} RMB</p>
  			</li>
  		</ul>
  		
  		<p class="order_li">配送方式</p>
  		<ul class="order_rad">
  			<li>
  				<label for="put">
  					<input type="radio" id="put" value="1" name="son"/>
  					<span>普通快递</span>
  				</label>
  			</li>
  			<li>
  				<label for="put1">
  					<input type="radio" id="put1" value="2" name="son"/>
  					<span>自提</span>
  				</label>
  			</li>
  			<li>
  				<label for="put2">
  					<input type="radio" id="put2" value="3" name="son"/>
  					<span>物流</span>
  				</label>
  			</li>
  			<li>
  				<label for="put3">
  					<input type="radio" id="put3" value="4" name="son"/>
  					<span>同城送货</span>
  				</label>
  			</li>
  		</ul>
  		<div class="order_zi">
  			适用于无框的文本作品，水彩画、版画、水墨画、摄影等
  		</div>
  		<p class="order_li">作品包装</p>
  		<ul class="order_rad">
  			<li>
  				<label for="out">
  					<input type="radio" id="out" value="1" name="int"/>
  					<span>不要包装</span>
  				</label>
  			</li>
  			<li>
  				<label for="out2">
  					<input type="radio" id="out2" value="2" name="int"/>
  					<span>木箱安全包装</span>
  				</label>
  			</li>
  			<li>
  				<label for="out3">
  					<input type="radio" id="out3" value="3" name="int"/>
  					<span>蜂巢纸箱包装</span>
  				</label>
  			</li>
  		</ul>
  		
  			
  		<p class="order_li">支付方式</p>
  		<ul class="order_rad">
  			<li>
  				<label for="money">
  					<input type="radio" id="money" value="1" name="money"/>
  					<span>微信支付</span>
  				</label>
  			</li>
  			<li>
  				<label for="money1">
  					<input type="radio" id="money1" value="2" name="money"/>
  					<span>余额支付</span>
  				</label>
  			</li>
  			<li>
  				<label for="money2">
  					<input type="radio" id="money2" value="3" name="money"/>
  					<span>在线网银转账</span>
  				</label>
  			</li>
  			<li>
  				<label for="money3">
  					<input type="radio" id="money3" value="4" name="money"/>
  					<span>对公银行转账</span>
  				</label>
  			</li>
  		</ul>
	<p class="order_loo">注意事项：办理汇款时请注明您的用户名。如果疑问请致电4006667899
		(周一到周五9:30-18:00)或添加客服微信shiyiyishu
	</p>
	
	
<!-- 	<ul class="order_img">
		<li><img src="/static/shop/img/order.png" /></li>
	</ul>
	<div class="order_bank">
		<p>开户行：中国银行</p>
		<p>账号：14234456456757</p>
	</div>
	 -->
	<div class="order_liu">
		<p class="order_li" style="border: none;width: 100%;">订单附言</p>
		<textarea class="order_shu" id="remark"></textarea>
		
	</div>
  <div class="ShareAnySeparate">
      <button id="submit" style="
        width: 20rem;
    height: 3.15rem;
    background: #231916;
    color: #FFFFFF;
    font-size: 1rem;
    text-align: center;
    line-height: 3.15rem;
    margin-top: 1rem;
    border-radius: .25rem;
    border: none;
    margin: 1rem 3rem;">保    存</button>
  </div>

<div class="call">
	<img src="/static/shop/mobile/img/tel111.png" />
	<p>收藏热线：400 666 7899</p>
</div>

<div class="footer">
	{include file="public:single"/}
</div>
<p class="icp">网站备案号：晋ICP备10002939号</p>
	</body>
	<script src="/static/shop/js/jquery-3.2.1-min.js"></script>
	<script src="/static/shop/js/PhoneJs.js"></script>
	    <script>
      $('label').click(function(){
        $(this).parent().parent().find('label').css('background','#f2f3f3')
        $(this).css({'background':'url(/static/shop/img/bg.png)','backgroundSize':'cover'})

      })
      $('#submit').click(function(){
          var arwork_id = $('#arwork_id').val();
          var arwork_title = $('#arwork_title').attr('data-title');
          var address_id = $('#address_id').val();
          var addrname = $('#addrname').attr('data-name');
          var address = $('#address').attr('data-addr');
          var mobile = $('#mobile').attr('data-tel');
          var price = $('#price').attr('data-price');
          var send_type =  $("input[name='son']:checked").val();
          var pack_type = $("input[name='int']:checked").val();
          var pay_type = $("input[name='money']:checked").val();
          var remark = $('#remark').val();
          if(!send_type){
              alert('请选择配送方式');
              return false;
          }
          if(!pack_type){
              alert('请选择作品包装');
              return false;
          }
          if(!pay_type){
              alert('请选择支付方式');
              return false;
          }
          $.ajax({
                    url: "{:url('shop/order/ajaxOrder')}",
                    type: "POST",
                    dataType: "JSON",
                    data: {
                        arwork_id: arwork_id,
                        arwork_title:arwork_title,
                        address_id:address_id,
                        addrname: addrname,
                        address:address,
                        mobile:mobile,
                        price:price,
                        send_type:send_type,
                        pay_type:pay_type,
                        pack_type:pack_type,
                        remark:remark,
                    },
                    success: function (data) {
                        alert(data.msg);
                        if (data.code == "0") {
                            window.location.href = data.data;
                        }

                    }
                });
      })
    </script>
</html>
